<!DOCTYPE html>
<html lang="zh-cn">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>GitHub升级后不再支持用户名密码鉴权 - Coding Night - A personal blog for Rango</title>
  <meta name="renderer" content="webkit" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>

<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<meta name="theme-color" content="#f8f5ec" />
<meta name="msapplication-navbutton-color" content="#f8f5ec">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#f8f5ec">


<meta name="author" content="Rango" /><meta name="description" content="⚠️ Support for password authentication was removed on August 13, 2021. Please use a personal access token instead. 登录 GitHub 打开 Settings 找到 Developer settings 找到 Personal access tokens 点击 Generate new token 配置 token 设置名字，设置过期时间，选择权限 (默认 repo 就可)，最后点击" />






<meta name="generator" content="Hugo 0.97.3 with theme even" />


<link rel="canonical" href="https://rangolee.github.io/post/github%E4%B8%8D%E6%94%AF%E6%8C%81%E7%94%A8%E6%88%B7%E5%90%8D%E5%AF%86%E7%A0%81%E9%89%B4%E6%9D%83/" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">



<link href="/sass/main.min.a659bb31b17a54f7792e1bc783fc75b31118e6a175b42337b03fae0b1a3ef2b5.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.1.20/dist/jquery.fancybox.min.css" integrity="sha256-7TyXnr2YU040zfSP+rEcz29ggW4j56/ujTPwjMzyqFY=" crossorigin="anonymous">


<meta property="og:title" content="GitHub升级后不再支持用户名密码鉴权" />
<meta property="og:description" content="⚠️ Support for password authentication was removed on August 13, 2021. Please use a personal access token instead. 登录 GitHub 打开 Settings 找到 Developer settings 找到 Personal access tokens 点击 Generate new token 配置 token 设置名字，设置过期时间，选择权限 (默认 repo 就可)，最后点击" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://rangolee.github.io/post/github%E4%B8%8D%E6%94%AF%E6%8C%81%E7%94%A8%E6%88%B7%E5%90%8D%E5%AF%86%E7%A0%81%E9%89%B4%E6%9D%83/" /><meta property="article:section" content="post" />
<meta property="article:published_time" content="2022-04-16T17:41:44+08:00" />
<meta property="article:modified_time" content="2022-04-16T17:41:44+08:00" />

<meta itemprop="name" content="GitHub升级后不再支持用户名密码鉴权">
<meta itemprop="description" content="⚠️ Support for password authentication was removed on August 13, 2021. Please use a personal access token instead. 登录 GitHub 打开 Settings 找到 Developer settings 找到 Personal access tokens 点击 Generate new token 配置 token 设置名字，设置过期时间，选择权限 (默认 repo 就可)，最后点击"><meta itemprop="datePublished" content="2022-04-16T17:41:44+08:00" />
<meta itemprop="dateModified" content="2022-04-16T17:41:44+08:00" />
<meta itemprop="wordCount" content="167">
<meta itemprop="keywords" content="github," /><meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="GitHub升级后不再支持用户名密码鉴权"/>
<meta name="twitter:description" content="⚠️ Support for password authentication was removed on August 13, 2021. Please use a personal access token instead. 登录 GitHub 打开 Settings 找到 Developer settings 找到 Personal access tokens 点击 Generate new token 配置 token 设置名字，设置过期时间，选择权限 (默认 repo 就可)，最后点击"/>

<!--[if lte IE 9]>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/classlist/1.1.20170427/classList.min.js"></script>
<![endif]-->

<!--[if lt IE 9]>
  <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
<![endif]-->

</head>
<body>
  <div id="mobile-navbar" class="mobile-navbar">
  <div class="mobile-header-logo">
    <a href="/" class="logo">Coding Night</a>
  </div>
  <div class="mobile-navbar-icon">
    <span></span>
    <span></span>
    <span></span>
  </div>
</div>
<nav id="mobile-menu" class="mobile-menu slideout-menu">
  <ul class="mobile-menu-list">
    <a href="/">
        <li class="mobile-menu-item">Home</li>
      </a><a href="/post/">
        <li class="mobile-menu-item">Archives</li>
      </a><a href="/tags/">
        <li class="mobile-menu-item">Tags</li>
      </a><a href="/categories/">
        <li class="mobile-menu-item">Categories</li>
      </a><a href="/about/">
        <li class="mobile-menu-item">About</li>
      </a>
  </ul>

  


</nav>

  <div class="container" id="mobile-panel">
    <header id="header" class="header">
        <div class="logo-wrapper">
  <a href="/" class="logo">Coding Night</a>
</div>





<nav class="site-navbar">
  <ul id="menu" class="menu">
    <li class="menu-item">
        <a class="menu-item-link" href="/">Home</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/post/">Archives</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/tags/">Tags</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/categories/">Categories</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/about/">About</a>
      </li>
  </ul>
</nav>

    </header>

    <main id="main" class="main">
      <div class="content-wrapper">
        <div id="content" class="content">
          <article class="post">
    
    <header class="post-header">
      <h1 class="post-title">GitHub升级后不再支持用户名密码鉴权</h1>

      <div class="post-meta">
        <span class="post-time"> 2022-04-16 </span>
        <div class="post-category">
            <a href="/categories/github/"> github </a>
            </div>
          <span class="more-meta"> 约 167 字 </span>
          <span class="more-meta"> 预计阅读 1 分钟 </span>
        
      </div>
    </header>

    <div class="post-toc" id="post-toc">
  <h2 class="post-toc-title">文章目录</h2>
  <div class="post-toc-content always-active">
    <nav id="TableOfContents">
  <ul>
    <li>
      <ul>
        <li><a href="#登录-github">登录 GitHub</a></li>
        <li><a href="#打开-settings">打开 Settings</a></li>
        <li><a href="#找到-developer-settings">找到 Developer settings</a></li>
        <li><a href="#找到-personal-access-tokens">找到 Personal access tokens</a></li>
        <li><a href="#点击-generate-new-token">点击 Generate new token</a></li>
        <li><a href="#配置-token">配置 token</a></li>
        <li><a href="#使用-token">使用 token</a></li>
      </ul>
    </li>
  </ul>
</nav>
  </div>
</div>
    <div class="post-content">
      <blockquote>
<p>⚠️ Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.</p>
</blockquote>
<h2 id="登录-github">登录 GitHub</h2>
<h2 id="打开-settings">打开 Settings</h2>
<h2 id="找到-developer-settings">找到 Developer settings</h2>
<h2 id="找到-personal-access-tokens">找到 Personal access tokens</h2>
<h2 id="点击-generate-new-token">点击 Generate new token</h2>
<h2 id="配置-token">配置 token</h2>
<blockquote>
<p>设置名字，设置过期时间，选择权限 (默认 repo 就可)，最后点击 <code>Generate</code> 生成 <code>token</code><br>
复制生成的 <code>token</code> (<strong>一定要复制保存，因为下次打开就没有了,没有了</strong>).</p>
</blockquote>
<h2 id="使用-token">使用 token</h2>
<blockquote>
<p>在原本的 git 地址前面加上刚才复制的 <code>token@</code> 就可以了，如下：</p>
</blockquote>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">https://&lt;token&gt;@github.com/&lt;username&gt;/&lt;repo&gt;.git
</span></span></code></pre></td></tr></table>
</div>
</div><p>示例:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># 你原本是这么用的:</span>
</span></span><span class="line"><span class="cl">git clone https://github.com/yourname/repo.git repo
</span></span><span class="line"><span class="cl"><span class="c1"># 现在是这么用</span>
</span></span><span class="line"><span class="cl">git clone https://ghp_lXdQ40bySDRq0jvDODSQO5NxaKDXDO360Zvq@github.com/yourname/repo.git repo
</span></span></code></pre></td></tr></table>
</div>
</div>
    </div>

    <div class="post-copyright">
  <p class="copyright-item">
    <span class="item-title">文章作者</span>
    <span class="item-content">Rango</span>
  </p>
  <p class="copyright-item">
    <span class="item-title">上次更新</span>
    <span class="item-content">
        2022-04-16
        
    </span>
  </p>
  
  
</div>
<div class="post-reward">
  <input type="checkbox" name="reward" id="reward" hidden />
  <label class="reward-button" for="reward">赞赏支持</label>
  <div class="qr-code">
    
    <label class="qr-code-image" for="reward">
        <img class="image" src="/img/reward/wechat.jpg">
        <span>微信打赏</span>
      </label>
    <label class="qr-code-image" for="reward">
        <img class="image" src="/img/reward/alipay.jpg">
        <span>支付宝打赏</span>
      </label>
  </div>
</div><footer class="post-footer">
      <div class="post-tags">
          <a href="/tags/github/">github</a>
          </div>
      <nav class="post-nav">
        
        <a class="next" href="/post/ios/ios-%E4%B9%8B-keypath-%E8%87%AA%E5%8A%A8%E6%8F%90%E7%A4%BA%E5%AE%8F/">
            <span class="next-text nav-default">iOS 之 keyPath 自动提示宏</span>
            <span class="next-text nav-mobile">下一篇</span>
            <i class="iconfont icon-right"></i>
          </a>
      </nav>
    </footer>
  </article>
        </div>
        

  

  

      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="social-links">
      <a href="mailto:rangodev@163.com" class="iconfont icon-email" title="email"></a>
  <a href="https://rangolee.github.io/index.xml" type="application/rss+xml" class="iconfont icon-rss" title="rss"></a>
</div>

<div class="copyright">
  <span class="power-by">
    由 <a class="hexo-link" href="https://gohugo.io">Hugo</a> 强力驱动
  </span>
  <span class="division">|</span>
  <span class="theme-info">
    主题 - 
    <a class="theme-link" href="https://github.com/olOwOlo/hugo-theme-even">Even</a>
  </span>

  

  <span class="copyright-year">
    &copy; 
    2016 - 
    2022<span class="heart"><i class="iconfont icon-heart"></i></span><span>Rango</span>
  </span>
</div>

    </footer>

    <div class="back-to-top" id="back-to-top">
      <i class="iconfont icon-up"></i>
    </div>
  </div>
  
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/slideout@1.0.1/dist/slideout.min.js" integrity="sha256-t+zJ/g8/KXIJMjSVQdnibt4dlaDxc9zXr/9oNPeWqdg=" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.1.20/dist/jquery.fancybox.min.js" integrity="sha256-XVLffZaxoWfGUEbdzuLi7pwaUJv1cecsQJQqGLe7axY=" crossorigin="anonymous"></script>



<script type="text/javascript" src="/js/main.min.64437849d125a2d603b3e71d6de5225d641a32d17168a58106e0b61852079683.js"></script>








</body>
</html>
